import { DeviceType } from "@babylonjs/core/DeviceInput/InputDevices/deviceEnums";
import { DeviceSource } from "@babylonjs/core/DeviceInput/InputDevices/deviceSource";


/**
 * 支持的输入设备对象
 * @param keyboard 键盘
 * @param mouse 鼠标
 * @param touch 触摸
 * @param xbox xbox手柄
 * @param switch switch手柄
 * @param dualScene ps5手柄
 * @param dualShock ps4手柄
 * @param generic 通用手柄
 */
interface IInputDevice {
    keyboard?: DeviceSource<DeviceType.Keyboard>,
    mouse?: DeviceSource<DeviceType.Mouse>,
    touch?: DeviceSource<DeviceType.Touch>,
    xbox?: DeviceSource<DeviceType.Xbox>,
    switch?: DeviceSource<DeviceType.Switch>,
    dualScene?: DeviceSource<DeviceType.DualSense>,
    dualShock?: DeviceSource<DeviceType.DualShock>,
    generic?: DeviceSource<DeviceType.Generic>,
}

/**
 * 输入状态
 * @param down 按下
 * @param up 抬起
 * @param click 点击
 * @param press 按住
 * @param none 无
 * @param move 移动（仅适用于pointer）
 * @param wheel 滚动（仅适用于pointer）
 */
enum InputStatus {
    down, up, click, press, none, move, wheel
}

/**
 * 所有支持的输入键，
 * 依次为键盘、鼠标及触摸、xbox手柄、switch手柄、ps5手柄、ps4手柄、（通用手柄待扩充），
 * （详略）
 */
enum DeviceInputKey {
    keyboardShift,
    keyboardA, keyboardB, keyboardC, keyboardD, keyboardE, keyboardF, keyboardG, keyboardH, keyboardI, keyboardJ, keyboardK, keyboardL, keyboardM,
    keyboardN, keyboardO, keyboardP, keyboardQ, keyboardR, keyboardS, keyboardT, keyboardU, keyboardV, keyboardW, keyboardX, keyboardY, keyboardZ,
    keyboardDigit1, keyboardDigit2, keyboardDigit3, keyboardDigit4, keyboardDigit5, keyboardDigit6, keyboardDigit7, keyboardDigit8, keyboardDigit9,
    keyboardDigit0, keyboardNumpad1, keyboardNumpad2, keyboardNumpad3, keyboardNumpad4, keyboardNumpad5, keyboardNumpad6, keyboardNumpad7,
    keyboardNumpad8, keyboardNumpad9, keyboardNumpad0, keyboardArrowUp, keyboardArrowDown, keyboardArrowLeft, keyboardArrowRight, keyboardSpace,
    keyboardMinus, keyboardNumpadSubstract, keyboardEqual, keyboardNumpadAdd, keyboardNumpadDivide, keyboardNumpadMultiply, keyboardNumpadDecimal,
    keyboardBracketLeft, keyboardBracketRight, keyboardSemicolon, keyboardQuote, keyboardBackslash, keyboardComma, keyboardPeriod, keyboardSlash,
    keyboardBackquote, keyboardBackspace, keyboardEnter, keyboardNumpadEnter,

    mouseLeft, mouseRight, mouseMiddle,

    pointer,

    pointerBrowserBack, pointerBrowserForward, pointerHorizontal, pointerLeftClick, pointerMiddleClick, pointerRightClick, pointerVertical,

    xboxA, xboxB, xboxBack, xboxDPadDown, xboxDPadLeft, xboxDPadRight, xboxDPadUp, xboxHome, xboxLB, xboxLS, xboxLStickXAxis, xboxLStickYAxis, xboxLT,
    xboxRB, xboxRS, xboxRStickXAxis, xboxRStickYAxis, xboxRT, xboxStart, xboxX, xboxY,

    switchA, switchB, switchCapture, switchDPadDown, switchDPadLeft, switchDPadRight, switchDPadUp, switchHome, switchL, switchLS, switchLStickXAxis,
    switchLStickYAxis, switchMinus, switchPlus, switchR, switchRS, switchRStickXAxis, switchRStickYAxis, switchX, switchY, switchZL, switchZR,


    dualSenseCircle, dualSenseCreate, dualSenseCross, dualSenseDPadDown, dualSenseDPadLeft, dualSenseDPadRight, dualSenseDPadUp, dualSenseHome,
    dualSenseL1, dualSenseL2, dualSenseL3, dualSenseLStickXAxis, dualSenseLStickYAxis, dualSenseOptions, dualSenseR1, dualSenseR2, dualSenseR3,
    dualSenseRStickXAxis, dualSenseRStickYAxis, dualSenseSquare, dualSenseTouchPad, dualSenseTriangle,

    dualShockCircle, dualShockCross, dualShockDPadDown, dualShockDPadLeft, dualShockDPadRight, dualShockDPadUp, dualShockHome, dualShockL1, dualShockL2,
    dualShockL3, dualShockLStickXAxis, dualShockLStickYAxis, dualShockOptions, dualShockR1, dualShockR2, dualShockR3, dualShockRStickXAxis,
    dualShockRStickYAxis, dualShockShare, dualShockSquare, dualShockTouchPad, dualShockTriangle,
}


export { DeviceInputKey, InputStatus };
export type { IInputDevice };